using Unity.Mathematics;
using UnityEngine;
public class VecMath
{

    public static double4x4 createMatrix4D(Matrix4x4 m)
    {
        return new double4x4(
            m.m00,
            m.m01,
            m.m02,
            m.m03,
            m.m10,
            m.m11,
            m.m12,
            m.m13,
            m.m20,
            m.m21,
            m.m22,
            m.m23,
            m.m30,
            m.m31,
            m.m32,
            m.m33);
    }

    public static double4x4 createMatrix4D(Matrix4x4 m, double3 translation)
    {
        return createMatrix4D(
            m,
            translation.x,
            translation.y,
            translation.z,
            1.0);
    }

    public static double4x4 createMatrix4D(Matrix4x4 m, double4 translation)
    {
        return createMatrix4D(
            m,
            translation.x,
            translation.y,
            translation.z,
            translation.w);
    }

    public static double4x4 createMatrix4D(
         Matrix4x4 m,
         double tx,
         double ty,
         double tz,
         double tw)
    {
        return new double4x4(
            m.m00,
            m.m01,
            m.m02,
            m.m03,
            m.m10,
            m.m11,
            m.m12,
            m.m13,
            m.m20,
            m.m21,
            m.m22,
            m.m23,
            tx,
            ty,
            tz,
            tw);
    }

    public static double4x4 createTranslationMatrix4D(
        double tx,
        double ty,
        double tz,
        double tw)
    {
        return new double4x4(
            1.0,
            0.0,
            0.0,
            0.0,
            0.0,
            1.0,
            0.0,
            0.0,
            0.0,
            0.0,
            1.0,
            0.0,
            tx,
            ty,
            tz,
            tw);
    }
}